package com.affablebean.model.test;

import java.sql.SQLException;

import com.affablebean.model.DbContext;
import com.affablebean.model.entity.Category;
import com.affablebean.model.entity.Product;

public class Driver {

	public static void main(String[] args) throws SQLException {
		DbContext dbContext = new DbContext();
		Category category = dbContext.getCategories().findById(2);
		System.out.println(category);
		
		Product product = dbContext.getProducts().findById(4);
		System.out.println(product.getCategory().getName());
		
		Category beyazEsya = new Category();
		beyazEsya.setName("Beyaz Eşya");
		
		dbContext.getCategories().add(beyazEsya);
		
		dbContext.getCategories().remove(beyazEsya);
	}
}
